IP Control Guide

IP Control Configuration

To enable IP Control, see IP Control.

Device Discovery via SDDP

Simple Device Discovery Protocol (SDDP) is a protocol developed by Control4 to allow devices to be added to a control system. webOS TV support protocol version 1.0.

  • On TV startup, TV sends NOTIFY ALIVE message.

  • When Control4 SDDP is enabled on IP Control Setup screen, it generates NOTIFY IDENTIFY message.

  • Before TV is powered off, it sends NOTIFY OFFLINE.

  • WebOS TV will also respond to SEARCH request method.

Device Discovery via SSDP

LG webOS TV supports Simple Service Discovery Protocol (SSDP) defined by UPnP Forum. There are three standard device and service types currently available for discovery:

  • urn:schemas-upnp.org:device:Basic:1

  • urn:schemas-upnp.org:service:dial:1

  • urn:schemas-upnp.org:device:MediaRenderer:1

From the Basic device, Manufacturer, TV's IP address, and Model Number can be obtained.

Each device/services also generate SSDP NOTIFY ssdp:alive and ssdp:byebye events upon powered up and down, respectively.

Encryption Protocol for IP Control Message Exchange

Encryption Specification

For IP Control message exchange, AES (Advanced Encryption Standard) is used with following specification:

  • Block Length: 128 bit

  • Key length: 128 bit

  • Initialization Vector (IV) length: 128 bit.

  • Block Cipher Mode: Cipher Block Chaining (CBC)

Encryption Key

Eight (8) digits (alphanumeric) password will be shown on IP Control Setting menu. IP Control client encrypts the password with PBKDF2 (Password-Based Key Derivation Function 2) method. First 16 Bytes of encrypted password are AES128 key. Following parameters must be used:

  • Algorithm: sha256

  • Salt: 0x63,0x61,0xb8,0x0e, 0x9b,0xdc,0xa6,0x63,0x8d,0x07,0x20, 0xf2,0xcc,0x56,0x8f,0xb9 Number of Iteration: 2**14

TCP port number 9761 is used on TV to receive all IP control commands.

IV Generation

IV is 16 byte string and must be randomly generated for each command encryption. It can be randomized using the secrets.token_bytes(16) function in Python, for example.

Operation

Clear text message must be terminated with '\r' (0x0d). Use VOLUME_MUTE on command as example.

If the length of the message is not multiple of 16, then padding is required.

The value to be padded is the number of bytes to be padded. In this case, it is 1. The entire 16 byte text in hex is 56 4f 4c 55 4d 45 Sf 4d 55 54 45 20 6f 6e 0d 01.

Apply AES-128 encryption algorithm. This will result in the follow cipher string in hex:

Output of AES 128 encryption is a string of length as input with padding.

Send to receiver with IV prefixed. Since IV is 16 bytes. Total length is (16 + olen)

IV must be encrypted using AES-128 ECB mode. If IV is 16 Os, the encrypted IV is: D2 82 1C AO AD 64 86 CB 20 56 AB 88 15 03 35 08

Send only the Encrypted message. In this case, it is byte streams: DF E7 7A 7D E0 56 03 AS 9E D5 31 6E CS 52 FA Cl On Linux, this is can done through command echo and nc as follows:

echo -e '\xd2\xd3\x2b\xfe\xac\x13\xf4\x43\x5e\x6f\x2f\x54\x2e\xea\x9c\x18 Inc <TV IP>  9761

Receiver applies decryption with a received IV from TV and encrypt the message using TV side IV. Please note that this IV is generated by TV and thus different than an IV generated at 4.3.. For "VOLUME_MUTE on" command, the response from the server is: ce 53 7c e4 b8 82 98 c6 a4 3e 21 89 af Sf 20 2f and after decryption:

A group of black text

Description automatically generated

For now, just ignore characters after '\n'

Wake-on-LAN

Wake-on-LAN (WoL) is performed by sending a magic packet to the TV's mac address to power it on. For that to work, both TV and the other device must be connected to the same subnet.

To enable WoL, go to Settings->General->Mobile TV On and set "Turn on via Wi-Fi" to on.

Note: Once IP Control is configured, the only way to turn the TV on from standby is with Wake-on-LAN.

A screenshot of a computer

Description automatically generated

The wake procedure for Wake-on-Wireless-LAN (WoWLAN) is the same as in wired case. Only you will need a Wi-Fi MAC address. The router needs to support Wireless Multimedia Extensions (WME or WMM) for WoWLAN to work.

The magic packet is a broadcast frame containing 6 bytes of all 255 (FF FF FF FF FF FF in hexdecimal), followed by sixteen repetitions of the target TV's 48-bit MAC address, for a total of 102 bytes.

Port number 4343 (Wake-on-LAN port) or any number can be used. TV's IP address or broadcast IP address can be used for destination address. For example, if your TV's IP address is 192.168.52.147, you would use 192.168.5.255.

When testing WoWLAN, you must disconnect the Ethernet cable.

New System Commands

Function

Command

Example Return Values

1 Manufacturer detail

GET_MANUFACTURER

Manufacturer: mfg name

2 Model name

MODEL_NAME

Model Name: WebOS22

3 Firmware version

FIRMWARE_VERSION

Firmware Version: 02.03.36

4 Firmware available

IS_FIRMWARE_AVAILABLE

Firmware Available: Yes / No

5 Power status

POWER_STATUS

Power Status: active / always ready

6 Current App +HDMI status

CURRENT_APP

APP: com.webos.app.hdmi1

HDCP: 1.4/2.2

Hot plug: connected / disconnected

Signal: Yes / No

7 Serial number

GET_SERIAL_NUMBER

Serial Number: SKJY107

8 Audio codes

GET_CURRENT_AUDIO codec

Audio codec: PCM/AC3

9 Signal detection: video

GET_CURRENT_VIDEO signal

Video signal type: 720x480

10 Audio output

GET_CURRENT_AUTIO output

Sound output: external_arc / tv_speakers

11 Friendly name

FRIENDLY_NAME

Friendly name: [mfg] webOS TV WEBOS22

12 ARC signal status

ARC_STATUS

Arc State: not_ready / eARC / ARC

13 Lamp hours

LAMP_HOURS

Lamp hour: 29/30/35…

 

PICTURE_MODE update (2023 updates)

New Picture Mode options are added for IP Control. Now it supports multiple picture modes within HDR or Dolby Vision content playing. Note that commands do not support change among SDR, HDR, or Dolby Vision as they are set by sources.

Example

PICTURE_MODE vivid

Picture Mode

SDR

HDR

Dolby Vision

Vivid

vivid

vivid

vivid

Standard

normal

normal

normal

Auto Power Save

eco

 

 

Cinema

cinema

cinema

cinema

Sports

sports

 

 

Game

game

game

game

 

KEY_ACTION update (2023 updates)

Two KEY_ACTION commands have been added. They pause or stop the playing content accordingly.

  • KEY_ACTION pause

  • KEY_ACTION stop

Command Reference List

TV Control Commands

Command is composed of two parts: Main commands with capital letters (e.g. VOLUME_MUTE) and their associated subcommands (e.g. On or Off). Some main commands for settings (e.g. PICTURE_BACKLIGHT) may have integer-based parameter values (e.g. 0-100). The specific use cases will be explained in the "Note" column in the below table.

Usage: [Main command] [Sub-command / parameter value] [Sub-command 2, if any]

Examples:

  • REMOTECONTROL_LOCK on

  • VOLUME_CONTROL 15

  • KEY_ACTION quickmenu

 

Function

Command

Note

1

Power

Main command: POWER

Sub-commands: off

Note: The TV does not support Always Ready and must be turned on using Wake-on-LAN.

2

Aspect Ratio

ASPECT_RATIO

4by3, 16by9, setbyoriginal

For video mode and live TV only

3

Screen Mute

SCREEN_MUTE

screenmuteon, videomuteon, allmuteoff

screenmuteon: mute OSD and video

videomuteon: mute video only

allmuteoff: turns off all mute types

4

Volume Mute

VOLUME_MUTE

on, off

 

5

Volume Control

VOLUME_CONTROL

0 to 100

 

6

Picture Mode

PICTURE_MODE

SDR: vivid, normal, cinema, game, eco, sports

HDR: vivid, normal, cinema, game

Dolby Vision: vivid, normal, cinema, game

IP control commands cannot switch between SDR, HDR, and Dolby Vision. That is set by the TV and content provider app/source device. If you switch an incompatible picture mode, the command will be ignored.

7

Backlight

PICTURE_BACKLIGHT

0 to 100

 

8

Contrast

PICTURE_CONTRAST

0 to 100

 

9

Brightness

PICTURE_BRIGHTNESS

0 to 100

 

10

Color / Colour

PICTURE_COLOUR

0 to 100

Please note the spelling of “COLOUR”.

11

Tint

PICTURE_TINT

0 to 100

0 = Red tint maximum

50 = No tint

100 = Green tint maximum

12

Sharpness

PICTURE_SHARPNESS

0 to 50

Note that this setting has a range of 0 to 50 unlike the rest.

13

Colour Temperature

PICTURE_COLOUR_TEMPERATURE

0 to 100

0 = Warm tone maximum

50 = Neutral tone

100 = Cold tone maximum

14

Remote Control Lock Mode

REMOTECONTROLLER_LOCK

on, off

 

15

Audio Balance

AUDIO_BALANCE

0 to 100

0 = Left maximum

50 = Left-Right balanced

100 = Right maximum

16

Audio Equalizer

AUDIO_EQUALIZER

1 to 5:

  1 = 100 Hz

  2 = 300 Hz

  3 = 1 kHz

  4 = 3 kHz
  5 = 10 kHz

 

0 to 20:

  0 = –10

  1 = –9

  …

  20 = +10

Sound > Sound Mode Settings > Equalizer must be ON

Example:

Tuning 1 kHz for 3

AUDIO_EQUALIZER 3 13

17

Energy Saving

ENERGY_SAVING

Auto, screenoff*, maximum, medium, minimum, off

*screenoff may not be compatible with some newer TV models

18

Tune Command

CHANNEL_SETTING_ATSC_ATV

[channel number] antenna

CHANNEL_SETTING_ATSC_ATV

[channel number] cable

CHANNEL_SETTING_ATSC_DTV

[channel number] cablemaj

CHANNEL_SETTING_ATSC_DTV

[major channel number] [min. channel number] antennanotphy

CHANNEL_SETTING_ATSC_DTV

[major channel number] [min. channel number] cablenotphy

ATV Example:

CHANNEL_SETTING_ATSC_ATV 11 antenna

 

DTV Example:

CHANNEL_SETTING_ATSC_DTV 10 2 antennanotphy

 

19

Channel Add / Del

CHANNEL_ADD_DELETE

add, delete

 

20

Key

KEY_ACTION

Exit, channelup, channeldown, volumeup, volumedown, arrowright, arrowleft, volumemute, deviceinput, sleepreserve, livetv, previouschannel, favoritechannel, pause, stop, returnback, captionsubtitle, arrowup, arrowdown, myapp, settingmenu, ok, quickmenu, videomode, audiomode, channellist, bluebutton, yellowbutton, greenbutton, redbutton, aspectration, audiodescription, programmorder, userguide, smarthome, simplelink, fastforward, rewind, programminfo, programguide, play, slowplay, soccerscreen, screenbright, number0, number1, number2, number3, number4, number5, number6, number7, number8, number9

Example (key command):

KEY_ACTION returnback

 

Example (toggle):

KEY_ACTION simplelink

21

Input Select

INPUT_SELECT

dtv, atv, cadtv, catv, hdmi1, hdmi2, hdmi3, hdmi4

APP_LAUNCH is the recommended method for selecting HDMI input.

Example:

APP_LAUNCH com.webos.app.hdmi3

22

Launch App

APP_LAUNCH

appid

See Example Application Identifications, for example application IDs.

23

Launch Always Ready

 

Smart Home Cards

LAUNCH_WEBOS_APP

 

Art, Clock, Movements, Moments, SoundPalette, LaunchGameCard, LaunchSportsCard

Veranda 4 and Solis do not support Always Ready and must be turned on using Wake-on-LAN.

Note that these subcommands contain capital letters.

 

Status Query Commands

 

Function

Command

Note

1

MAC Address

GET_MACADDRESS

wired, wifi

 

2

Mute State

MUTE_STATE

 

3

Current Volume

CURRENT_VOL

 

4

Current App

CURRENT_APP

 

5

Get IP Control State

GET_IPCONTROL_STATE

Return ON if server is healthy. Otherwise, the command will time out.

Example Application Identifications (appid)

webOS has unique appids that are used with the APP_LAUNCH command.

Example: APP_LAUNCH com.webos.app.lgchannels

This command launches LG Channels Home.

The following are example appids of other system built-in apps on webOS 4.0 or later.

Applications

Identifications (ID)

Settings

com.palm.app.settings

Photo & Video

com.webos.app.photovideo

Music

com.webos.app.music

Guide

com.webos.service.iepg

Browser

com.webos.app.browser

HDMI

com.webos.app.hdmi1

com.webos.app.hdmi2

com.webos.app.hdmi3

com.webos.app.hdmi4

 

Sixty of the most popular webOS applications and their appids are listed below:

Applications

Identifications (ID)

Aha

aha

Amazon Alexa

amazon.alexa

Amazon Music

com.theadelab.amclient-lg

Amazon Prime

amazon

AMC+

com.amcplus1.app

Apple Music

com.apple.applemusic

Apple TV

com.apple.appletv

Apple TV+

com.apple.appletv.web

BritBox by BBC & ITV

com.britbox.webos

CBS News

com.app.cbsnews

dicovery+

com.discovery.dplus

Disney+

com.disney.disneyplus-prod

DuplexPlay

com.duplexiptv.app

Freevee

imdbtv

Fubo

com.fubotv.app

Funimation

com.funimation.webapp

GLWiz

glwiz

Haystck Local & World News

com.haystacktv.app

HBO Max

com.hbo.hbomax

Hulu

hulu

IBO Player

iboplayer

IPTV Smarters

com.iptvsmarters.app

LG Channels

com.webos.app.lgchannels (lgchannels.us)

Max

com.wbd.stream

Movies Anywhere

com.moviesanywhere.app

Netflix

Netflix

Newsmax

newsmax

OnDemandKorea

com.ondemandkorea.ctv.webos

Pandora

pandora.lgerp.app

Paramount+

com.cbs-all-access.webapp.prod

Peacock

com.peacock.tv

Plex

cdp-30

Pluto TV

com.plutotv.app

Pure Flix

com.pureflix.smarttv

Redbox

com.twc.csg.redbox

Shahid

net.mbc.shahid-lgapp

Shop Time

com.lgshop.app

Showtime

com.showtime.app.showtime

Showtime Anytime

com.showtime.app.showtimeanytime

SiriusXM

sir.12465.3738

SlingTV

com.movenetworks.app.sling-tv-sling-production

Smart IPTV

siptv

Smart STB

smartstb

SmartOne IPTV

com.smartone-iptv.app

Spotify

spotify-beehive

SSIPTV

com.ssiptv.app

STARZ

com.starz.app.starz-lgtv

TikTok TV

com.tiktok.app.tv

Tubi

com.tubitv.ott.tubi

TV Cast

de.2kit.castbrowserlg

Twitch

tv.twitch.tv.starshot.lg

Viki

com.viki.lg

Vix

vix

VUDU

vudu

WebVideo Caster

com.instantbits.cast.webvideo

Xfinity Stream

com.comcast.app

YouTube

youtube.leanback.v4

YouTube Kids

youtube.leanback.kids.v4

YouTube TV

youtube.leanback.ytv.v1

ZeeS

com.zeeS.app